package com.ty.provider;

import com.ty.dto.Invertory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

@Service
public class MessageProduct1 {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(Invertory invertory){

        rabbitTemplate.convertAndSend("exchange.topic", invertory.getOptionType().toString(),  invertory);
        System.out.println("发送消息：" + invertory);
    }
}
